<!-- Generated automatically from an XML file of the same name.
     Copyright: Stephen J. Sangwine and Nicolas Le Bihan, 2008-2010.
--><html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>normq :: Functions (Quaternion Toolbox Function Reference)
</title><link rel="stylesheet" href="qtfmstyle.css" type="text/css"></head><body><h1>Quaternion Function Reference</h1><h2>normq</h2>
<p>Norm of a quaternion</p>
<h2>Syntax</h2><p><tt>Y = normq(X)</tt></p>
<h2>Description</h2>
    <p>
        <i>(Not to be confused with the function <tt>norm</tt>
        which computes a matrix norm.)</i>
    </p>
<p>
<tt>normq(X)</tt> returns an array <tt>Y</tt> such that each
element of <tt>Y</tt> is the norm of the corresponding element of
<tt>X</tt>. The norm is the sum of the squares of the four
components (three components in the case where <tt>X</tt> is pure).
</p>
<p>
If <tt>X</tt> is a complex quaternion, <tt>normq(X)</tt> returns
the complex semi-norm, computed in the same way.
The semi-norm of a complexified quaternion can vanish (see references).
</p>

<h2>Examples</h2>
<pre>
normq(quaternion(1,1,1,1))

ans = 4
</pre>
<tt>normq</tt> is vectorized, and hence can operate on arrays:
<pre>
abs([qi, qj, qk, qi + qj])

ans = 1     1     1     2
 </pre>
It can also operate on complex quaternions yielding a complex result in
general (the semi-norm):
<pre>
&gt;&gt; normq(1 + i + qi + qj + qk)

ans = 3.0000 + 2.0000i
</pre>
The following shows that a complex quaternion can have a vanishing
norm and modulus:
<pre>
&gt;&gt; normq(i + qi)

ans = 0
</pre>

<h2>See Also</h2>QTFM functions: <a href="abs.html">abs</a>, <a href="norm.html">norm</a><br>
<h2>References</h2><ol><li>Sangwine, S. J. and Alfsmann, D.,
'Determination of the biquaternion divisors of zero,
including the idempotents and nilpotents',
e-print arXiv:0812.1102, 8 December 2008, available at
<a href="http://arxiv.org/abs/arxiv:0812.1102">http://arxiv.org/abs/arxiv:0812.1102</a>.
</li><li>W. R. Hamilton,
Lectures on Quaternions, Lecture VII, &sect;672, p669.
Hodges and Smith, Dublin, 1853.
Available online at: <a href="http://historical.library.cornell.edu/math/">http://historical.library.cornell.edu/math/</a>.
</li></ol>
<h4>&copy; 2008-2010 Stephen J. Sangwine and Nicolas Le Bihan</h4><p><a href="license.html">License terms.</a></p></body></html>